import request from '@/utils/request.js'
import {useTokenStore} from '@/stores/token.js'

//文章分类列表查询
export const articleCategoryListService = ()=>{
    const tokenStore = useTokenStore();
    //在pinia中中响应的数据，都不需要写.value
    // return request.get('/category',{headers:{'Authorization':tokenStore.token}})
    return request.get('/category')
}
//文章添加接口
export const articleCategoryAddService = (categoryModel)=>{
    return request.post('/category',categoryModel)
}
//文章分类修改
export const articleCategoryUpdateService = (categoryData)=>{
    return  request.put('/category',categoryData)
}
//删除文章接口
export const articleCategoryDeleteService = (id)=>{
    return  request.delete('/category?id='+id)
}
//文章列表查询
export  const articleListService = (params)=>{
    return  request.get('/article',{params:params});
}
//添加文章
export const crticleAddService = (article)=>{
    return request.post('/article',article)
}

